package com.slz3.business.module.socialManagement.socLife.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.socialManagement.socLife.domain.SocLife;
import com.slz3.business.module.socialManagement.socLife.domain.SocLifeCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SocLifeResController {

    static Mono<ServerResponse> add(ServerRequest req, SocLife socLife) {
        if (SocLifeResUnsafeValid.add(req, socLife)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocLifeResAtomic.add_$SocLifeUpdateLock(req, socLife);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, SocLifeCondition socLifeCondition) {
        if (SocLifeResUnsafeValid.delete(req, socLifeCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocLifeResAtomic.delete_$SocLifeUpdateLock(req, socLifeCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, SocLife socLife) {
        if (SocLifeResUnsafeValid.modify(req, socLife)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocLifeResAtomic.modify_$SocLifeUpdateLock(req, socLife);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (SocLifeResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocLifeResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (SocLifeResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocLifeResAtomic.info_$SocLifeUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (SocLifeResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocLifeResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, SocLifeCondition socLifeCondition) {
        //
        if (SocLifeResUnsafeValid.auditSubmit(req, socLifeCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocLifeResAtomic.auditSubmit_$SocLifeUpdateLock(req, socLifeCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, SocLifeCondition socLifeCondition) {
        if (SocLifeResUnsafeValid.audit(req, socLifeCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocLifeResAtomic.audit_$SocLifeUpdateLock(req, socLifeCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, SocLifeCondition socLifeCondition) {
        if (SocLifeResUnsafeValid.auditReject(req, socLifeCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocLifeResAtomic.auditReject_$SocLifeUpdateLock(req, socLifeCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, SocLifeCondition socLifeCondition) {
        if (SocLifeResUnsafeValid.usingEnable(req, socLifeCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocLifeResAtomic.usingEnable_$SocLifeUpdateLock(req, socLifeCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, SocLifeCondition socLifeCondition) {
        if (SocLifeResUnsafeValid.usingDisable(req, socLifeCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SocLifeResAtomic.usingDisable_$SocLifeUpdateLock(req, socLifeCondition);
        }
    }

}
